﻿<UserControl x:Class="XWord.WPF.ApplicationFramework.TestModules.validationsimple.ValidationTriggerElementSimple"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:validations="http://schemas.xword.com/winfx/xaml/info"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <TabControl>
            <TabItem Header="Trigger">
        <StackPanel HorizontalAlignment="Left">
            <TextBox Width="100" x:Name="Element_TextBox1"></TextBox>
            <TextBox Width="100" x:Name="Element_TextBox2"></TextBox>
            <validations:RequiredValidator
                          Property="{Binding Text,ElementName=Element_TextBox1}"
                          GapValidateSecond="1"                  
                          TriggerElement="{Binding ElementName=xxx}"/>
            <validations:RequiredValidator
                           Property="{Binding Text,ElementName=Element_TextBox2}"
                           TriggerElement="{Binding ElementName=xxx}"/>
            <Button x:Name="xxx">xxxx</Button>
        </StackPanel>
            </TabItem>
            <TabItem Header="Tigger as Store">
                <StackPanel HorizontalAlignment="Left">
                    <TextBox Width="100" x:Name="Tab2_Element_TextBox1"></TextBox>
                    <TextBox Width="100" x:Name="Tab2_Element_TextBox2"></TextBox>
                    <validations:RequiredValidator
                          Property="{Binding Text,ElementName=Tab2_Element_TextBox1}"
                          GapValidateSecond="1"                  
                          TriggerElement="{Binding ElementName=Tab2_xxx}"/>
                    <validations:RequiredValidator
                           Property="{Binding Text,ElementName=Tab2_Element_TextBox2}"
                           TriggerElement="{Binding ElementName=Tab2_xxx}"/>
                    <Button x:Name="Tab2_xxx" validations:Validator.TriggerType="Store">xxxx</Button>
                </StackPanel>
            </TabItem>
        </TabControl>
    </Grid>
</UserControl>
